cleanup and commenting, all debug code now in MYDEBUG macro