distance constraint - improovments