version with multiple output files
merged with head