Jj game logic