Updating comments

Updating comments and rearranging code