FIX warnings
update indentation and DEBUG message
remove some unnecessary DEBUG messages
update ocmments and print DEBUG only if it's a leaf