started checkWin function