Moved functions to a dot sourced file.  Added input checking.  Added handling empty checkPath.