add sequence_value, and modify slightly the existence check; add tests and docs