Updated cachematrix.R to reflect requirements