updated commenting for easier read throughout the main js file