cleaned up comments and formatting