pulled from robot
added some debug print statements