Modified the code formatting and improved the documentation.