If `maxDistance` is negative, is that the same as if `maxDistance` is zero? Probably could use a test case to confirm.