added checkWinner function
merged