updated documentation and removed debug code