Update with tests and an example.