Renamed k,a variables and made another small correction in derivatives