writing methods-aggregation function