> Everything works nicely, and you package the code in a function for later use but forget about the scale factor introduced earlier in the notebook.
You see a problem, you fix it with library, and I applaud that. You have to wonder though, how many years does it take for a reproducible notebook environment to implement out of scope variable guards..