Given example addapted to calculate inverse matrix