Added new comments for clarity
Formatted code for easy read
Formated Code