Updated cachematrix.R to complete Assignment2