Write a formula for the general term (the nth term) of the geometric sequence.
2, -1, \frac{1}{2}, -\frac{1}{4}, \frac{1}{8}, ...
A. $a_n = 2( -\frac{1}{2})^n$
B. $a_n = 2( -\frac{1}{2})^{n+1}$
C. $a_n = 2( -\frac{1}{4})^{n-1}$
D. $a_n = 2( -\frac{1}{2})^{n-1}$