Fixed writeRecipe method to produce the right format