Added a factory for the run-time specification of the desired distance.