Initial stab at it

Still need to write a demo and test this.