Added: various functions to format output