changed boundaries back to using distance from boundary as indicators of crossing