adding comments. removing debug output.