Bugs fixed in gameState.

Now it works but it can only solve simple maps.