Edited cachematrix.R with Programming Assignment 2 code