def find_best_hit(query):
    """ Takes a blast query record and returns the hit and bit score.
        Also returns bit score of next best hit if any.
    """

    query_id = query.query
    best_hit = "No hit"
    best_score = None
    next_score = None

    # If there are no alignments then skip
    if not len(query.alignments) == 0:
        
        # Get hit of best alignment
        best_hit = query.alignments[0].title
        best_score = query.alignments[0].hsps[0].bits
        
        # If there is a 2nd hit then get bit score of that
        if len(query.alignments) > 1:
            next_score = query.alignments[1].hsps[0].bits

    return query_id, best_hit, best_score, next_score