changed the way of finding a winner