added some comments and removed an errant debugger statement