D525 edited R stub to do inverse matrix