refactored adding color and general output function.