fix indices deriv x is in j and z in i