If I were you I would simply create another moduel to your program that converts your private variables and work into strings for output. Or you could just do something along the lines of this:

...