First iteration of cachematrix.R