Adding back original code with debugging output