moved most output functions to output.cpp