Modified cachematrix.r