added some print statements in run()