created formatFunctions in main, working on returned datastructures