def set_ranks(results):
    """
    Add rank to results considering ties
    @:param results (list): Sorted results
    """
    results[0]['rank'] = 1
    if len(results) > 1:
        for i in range(len(results) - 1):
            r1 = results[i]
            r2 = results[i+1]
            s1 = r1['score']
            s2 = r2['score']
            if s1 == s2:
                r2['rank'] = r1['rank']
            else:
                r2['rank'] = i + 2
    return results