Modified cacheSolve.R as part of Prog Ass 2