# All of code will not run

I have one group of students who are working on the autonomous portion of their competition code for the Over/Under game. The first half of their code works just fine, where it is driving forward. The robot will not run the reverse portion of the code. Any help is appreciated.

Here is the code:

``````right1.setVelocity(68,vex::velocityUnits::pct);
right2.setVelocity(68,vex::velocityUnits::pct);
left1.setVelocity(60,vex::velocityUnits::pct);
left2.setVelocity(60,vex::velocityUnits::pct);

right1.setPosition(0, degrees);
right2.setPosition(0, degrees);
left1.setPosition(0, degrees);
left2.setPosition(0, degrees);

left1.spinFor(forward, 1000, degrees,false);
left2.spinFor(forward, 1000, degrees,false);
right1.spinFor(forward, 1000, degrees);
right2.spinFor(forward, 1000, degrees);

wait(1, seconds);

right1.setPosition(0, degrees);
right2.setPosition(0, degrees);
left1.setPosition(0, degrees);
left2.setPosition(0, degrees);

left1.spinFor(reverse, 1000, degrees,false);
left2.spinFor(reverse, 1000, degrees,false);
right1.spinFor(reverse, 1000, degrees);
right2.spinFor(reverse, 1000, degrees);
``````

I’m not entirely sure if this is the issue, but it looks like you spin `right1` 1000 degrees, then wait for that motor to finish spinning before spinning `right2` for 1000 degrees. I’m assuming you want both `right1` and `right2` to spin at the same time, so change `right1.spinFor(forward, 1000, degrees)` to `right1.spinFor(forward, 1000, degrees, false)` and do the same for the reverse part of the code. Another change you could make is to create a motor group for both the left motors and both the right motors, which would reduce the amount of repetition in your code, and thus reduce the the amount of potential bugs (unless you are using an x-drive or mecanum drive).