View code pretty much ready.

But untested.