matrix inversion code added