build aggregation frame, count lines