implemented the cachematrix.R