first version cachematrix.R