Implementation of the cachematrix.R