Undo redo working in a non intelligent manner. Working on cursor next.