add max-element and min-element