undo and swp enhancements