first working version of cachematrix.R