Implemented path parsing function.