Cleanup and documentation

Improved documentation and cleanup