remove print statements inside gradient computation