moved logic from main.go to gamestateserver.go