It’s your last line of autoDriveDist, which makes it recursive. You’ve created an infinite loop. You’re already down to a speed of -21 when you finish the second time, so it may be pretty much stopped. Regardless of when it happens, you’ll be asking the robot to drive at a tiny speed, small enough it can’t move the robot, until it travels 50. It will never get there. So even a few iterations of this will never end. Even if they each would, you’d still have an infinite loop. You never exit autoDriveDist.