Servos moving unpredictably

Please read the "How to use this forum" post, and post your code properly, using code tags.

95% or more of servo problems reported on this forum are due to an inadequate servo power supply. You need a separate servo power supply, capable of providing 5V to 6V, and capable of delivering at least 1 Ampere per servo. Connect all the grounds together.