added a lot of comments to the server, fixed some stuff