add more output, simpler header handling