still seg fault on finding a target, changed to recursive