Created logic for tic-tac-toe board