data retrieval into other two fucntions