Created a new function to write to a specific line of a text file.
Adjusting to the new file writing function.