More debug; minor tweaks with clarity of code