cleanup and some documentation.