data save update

data is written at the end of the calculation only