Remove debug code and a little more documentation