My first version of cachematrix