length-comparing heuristic