created functions that cache matrix inversion