fix bug WORKS NOW!

yeah! now we have the r matrix without bugs hopefully