modified pseudo inverse matrix