cachematrix.R working