changes to cachematrix.R after benchmarking the computation time