implemented checkWin-method