different implementation for tic-tac-toe