Added cachematrix solution