second version cachematrix.R