modifying the file manipulation script