made changes to cachematrix.R