minor changes and alteration to debug code