finised fits write function v2