Added END logic so that server creates a file and prints it