Implemented game logic for alternating players, and checking for win conditions