output handling included
merged