Tic Tac Toe using javascript and canvas