getPathOrder function

Get path order