Improved documentation and formatting