revert debug code; clean up