Alternative implementation of inverse matrix operation