Fixes game logic errors and adds some comments