re-order console output functions, add proper prototypes,