implementation

cache matrix implementation