added comments and more