add fun.aggregate in reformat