added some debugging prints