added some comments to gamelogic.lua