Code for path work