Added comments, and formatting