Add more writing logic