Modified output directory and file methods to utilize os.path.join for OS compatibility