adding functions to cache matrix inversion and make use of it