Add better max and min location setting