add the output function

Signed-off-by: Jack Tan <jiankemeng@gmail.com>