Add retrieval functions to matrix.