made some changes to gamestate logic