start of editor code