Initial version of cachematrix code based on the cachemean code