added dR function