Fixed game framework

fixed order, reorganized, and added comments to clarify