use the Preserve() function to preserve line and cursor position instead of mark z