added comments and adjusted line lengths to fit style guide