Final version of the cached Matrix implementation in R