Updated documentation and removed some unused code.