working on matrix inversion