modified cachematrix.R file