Saving data, many small additions to make program behave in sane way.