fixup! Rewrite documentation to be in line with new algorithm. Use more
comprehensive test.