Simple code moving forward

Delays block the code from doing anything else until they are done, so I would highly recommend you take the delays out and take a look at the example sketch Blink Without Delay. Learn how that sketch works and incorporate it into your code.

We wrote some complicated code and it did not work at all.

Exactly what didn't work? You can also use the serial monitor to see your distance readings and other values to see where the problem(s) occur.