removed inv_R from the C code, because the algorithm doesn't need it.