updated output routine