selectPoints function added

The selection of points was removed from the analysis function and
given its own call.