Added comments, some cleanup