Implemented cachematrix.R functions