added javadocs and renamed game state to mode