editing mode almost finished, some bugs to be eleminated