refactor hand comparison to sort a list of hands