remove debugging code; clean up for including in scripts repo