Restored documentation on distance algorithm.