updating for case of a tie