Adding the writing of ast