Under the Act of Federation each province was free to write its own constitution and form its own government. Other regions of the New Kingdom of Granada established their own governments and confederations (for example, the Confederated Cities of the Cauca Valley,1811–1812) or remained royalist. At the beginning of the revolution, the larger Viceroyalty of New Granada consisted of 22 provinces. The provinces were under the jurisdiction of two "audiencias". The Royal Audiencia of Quito, whose president had executive powers, had jurisdiction over the provinces of Quito, Cuenca, Loja, Ibarra, Riobamba, Pasto, Popayán, Buenaventura and parts of the Cauca River Valley. These provinces were located in what are now the Republic of Ecuador and the southern part of Colombia. The Royal Audiencia of Santa Fe de Bogotá, had jurisdiction over the provinces of Panamá and Veragua in what is now the Republic of Panama, and the provinces of Antioquia, Cartagena de Indias, Casanare, Citará, Mariquita, Neiva, Nóvita, Pamplona, Riohacha, Santafé, Santa Marta, El Socorro, and Tunja. The Audiencia of Quito, despite an attempt at establishing a junta in 1809, remained a royalist stronghold throughout the wars of independence. The territory of the Captaincy General of Venezuela had been part of the viceroyalty, but had become independent of it when the captaincy general was established in 1776, and therefore, never became part of the United Provinces. The Captaincy General had jurisdiction over the provinces of Coro, Cumaná, Guayana, Maracaibo, Venezuela or Caracas (central Venezuela), and Margarita Island, and it had its own "audiencia" and superintendency based in Caracas. After the Revolution the captaincy general established itself as a republic.