Added matrix retrieval functions