Code for editor