made output function less confusing