massive rehaul of output functions