The output in your functions are all over the place. Regardless, it would be impossible to put those two functions side by side because you're creating a new line every time a number is output in your K function. I would suggest getting rid of your "Heading" function and just adding tabs in your K function before the line is ended to allow for values to be input in a column next to it.