Add copyFile function