add csvout/aggregate.csv and  modify the script to generate it