completed the cachematrix.R functions