First version of cachematrix