modified code for commit cachematrix - SKC