Use println, don't pass output function around.