For debugging purposes, I'd probably not return the immediate output of a function. I'd suggest setting this to a variable on a line above and return that variable.