modified the cachematrix.r