Added comments to the code and implemented the framework for multiplayer