First working multiplayer version
Some minor fixes and optimizations