some final changes
some cleanup and documentation