Added checks for valid selection of points