Added option to remember last cursor position