Writing the history, and setting the correct version number