slight generalization of rrt code, in preparation for complex ideas.