Project 10 - Zoetrope , The motor spin in only one direction

Hi everyone
I also just copied the code and uploaded it to the Arduino board. Everything works just fine. I noticed however that the potentiometer and the switches easily goes loose on the breadboard. (I use the components from the Arduino Starter Project).