before max-sum