gamecode now handles keyboard input better