(here)

Instead of print for these two method calls `toJson()/toJsonP()`, we could assign the return value to a variable and write to file below within the main scope. Keeps the file writing behavior out of the class itself in case it's being re-used for something else that doesn't need file writing. 

Much thanks!