initial organization
automatic rolling & reset
added tracking for contenteditable