Corrected error which had occoured while changing variable names in kd.cpp eqn D
Output after changed vars