added output function