added changes to cachematrix.R