Use running sum approach