updating the cachematrix programme with solution