Added comments and formatting from code review