changed game loop to pure func comp
flattened game state map