cleaned game code