update GUI and data structure