Tic Tac Toe Algorithm Java