complete the cachematrix function in cachematrix.R