updated editor.cs for better functionality