WIP Completed documentation and did a bit of refactoring as well.