Remove diagnostic output to console and add comments