More efficient matrix inversion