Added improved documentation and formatting.