Update with more documentation and formatting.