Complete functions to create and query matrix wrapper