start moving printing of output to logging; clean up code (#62)