removed dead code, improved comments
rebuilt docs to reflect changes to code