move function for getting program base directory to appropriate source file