added comments, fix indentions