Sterilised inputs. Now allows the user to enter a new file name if they enter an invalid one, rather than crashing the program.