Modifying script to get rid of kd as well