First naïve implementation.

Seems to work.