cleaned up the comments and formatting