added a simple matrix inversion method.