edit file, not fully tested