moved game logic to server * major refactoring