Update cachematrix.R

Modify functions to cache a matrix and its inverse