output function definition