Basic initial work, still trying to wrap my head around the spec and the best way to implement it.