Working on getData function