Refactored code: Begun adding comments and enforcing conventions