More tests, updated implementation.