add max_sum feature for chain