Proposing an alternate impl.

@bifodus, I'm not expecting this to get merged.  Just posting it.  Thoughts?