Task 2: Compute new values using aggregation and custom functions