second modification to cachematrix.R