Added first version of cachematrix impl