maze solver with 3 ultrasonic help in code

What does the code do that you don't want it to?
What doesn't the code do that you do want it to?

What stops a late return from an earlier ping being interpreted as a nearer return?

Why don't the comments describe the code?