Tic Tac Toe Game implementation in Java Script