keep the data struct up to date