add agregat and modify output file format