Added useful comments, made small changes to server