Added the code for reversing the string to the file.