Changing file = new File("test.txt"); to file = new File(args[0]);.
Ready for submission