cleanup and partial documentation.