now calls output function