use smaller maximum distance for performance