Adding functions to cachematrix