changed the code not to rely on existing data file