updated file cachematrix.R for R Programming assignment 2