Amazon MG995 Servo Irregularly Oscillates Back and Forth; Cannot Set Position

Hello all, I am new to the whole arduino thing, but for a school project I have to control the position of a servo, MG995 from Amazon. I ensured pins are connected properly (brown gnd, red 5v vcc, pale GPIO 9). When connecting to my computer the servo simply moves back and forth, despite values in code, or even having code loaded. How do I control the position of the arm, and is my servo broken?

Nevermind, it turns out, a little help from a 6v battery pack was all it needs