created a get_data function to make it happen