Crossover Agent Edits:
added splitPath function

<not tested>
Crossover Agent Edits:
stable version of splitPath() function

<tested>