Modified cachematrix.R