lastPath Function

Last Path Function moved in to a try