This implementation seemed pretty wrong in multiple ways; I attempted to fix it (a long time ago) (see diff, you'll see what I'm talking about), then gave up. Luckily (?) the code is unused, just sitting there, sad and broken.