added min and max