Implementation of cachematrix file