clean up debugging code and whitespace