More documentation work done. Cleaned up unused code which was commented out.