add min and max
add partition