cleaned up RRT code