Final marked up version of cachematrix.R