move checkWin function into if/else statement