revised docstring for boundary detection