Added documentation comments.
Removed some TODO comments from the code, instead adding them to the TODO list (not currently in the repository).