cachematrix.R uses Lexical scoping