edited code cachematrix.R