Modified cachematrix.R as required