1. Add the write file part