Initial working code

The game is playable at this point.