Made a few tweaks to the document and code