necessary code changes made to the cachematrix.R