added test for maxiumum distance