Revert "Matrix inversion"

This reverts commit 6c83de04bf11130028f39af844ec3d757ff47cac.