Implemented the functions in cachematrix.R