Can someone help me solve this motor control issue

Quick Update:

The second code turned out to have the same issue as the first leaving me in the same predicament as before.