Added some comments and did some housekeeping