implemented tuple and relation retrieval