Implement cachematrix.R functions