Added function to determine new file name