Rewrite pathParent using branches.
Finally got pathParent working