add copious print statements for debugging