added data retrieval code