debugging code IMPORTANT mixed in with some valueable code changes