Working on the get data function