functions to compute/cach matrix inverse addes