adding revised cachematrix.R file