have max and min selection working