What is the main function of a state legislature?

A)appointing judges
B)attending town meetings
C)deploying the National Guard
D)passing laws

Please help me!!!!