Edited code on cachematrix.R