adding revised cachematrix.R script for programming assignment 2