cleanups
use instance var i/o global var as debug guard
put debug messages back in place