Refactored according to the style guide on google drive.