end for for j = 1 . . . n do for l = 1 . . . j -1 do The derivative of the cartesian coordinate of the j-th atom after the Z-matrix coordinates of the l-th atom with l < j has to account for the propagation of the reference frame M.