fixing missing constant; moving debug statements to something cleaner