Added documentation and a few minor edits