Based on the table, find the variance.

X 1 2 3 4
P(x=x) .4 .3 .2 .1

I previously computed the mu and got 2 as an answer.
what I did:
(.4) (1-2)^2+ (.3) (2-2)^2 + (.2) (3-2)^2 + (.1) (4-2)^2
but I don't know if I used the formula correctly

And then the standard deviation is the square root of the variance?