Cleaned up the comments and added to them for completeness.