added function to return data