restrict the scope of extended version of sum, max, and min