output function and accept functions in #3