Final version of cachematrix.R Assignment