added comments and modified declarations to comply with the style guide