added support for editing and dragging