Update (5.24) cache matrix.R

Updated with comments