update code - add debug code