added logic to calculate the winner of the match
misc