Rewriting of modified file works ... almost ! Need order keys