saving cachematrix code