save-current-pos implemention