Seems to be working (and fast!), but segfaults under parrot.