The purpose of the right to bear arms is twofold; to allow individuals to protect themselves and their families, and to ensure a body of armed citizenry from which a militia could be drawn, whether that militia's role was to protect the nation, or to protect the people from a tyrannical government.
