Added cutoff to path search