rewrite notebook.txt on each step