creating inverse matrix