small modification in perturbation code