added comments and code headers