Write the files and titles correctly