removing sys outs and inserting debug logs