def find(self, term, limit=0, sort=False, ranks=None):
        ranks = ranks or self.ranks
        found_indices = []
        count = 0
        if not limit:
            for i, card in enumerate(self.cards):
                if check_term(card, term):
                    found_indices.append(i)
        else:
            for i, card in enumerate(self.cards):
                if count < limit:
                    if check_term(card, term):
                        found_indices.append(i)
                        count += 1
                else:
                    break
        if sort:
            found_indices = sort_card_indices(self, found_indices, ranks)
        return found_indices