implemented the recursive idea acording to first sketches. loops indefinitely for two points.