recurses along the path