Adds some comments and removes some debug code.