Updated to remove extraneous printf calls.