Teutonic Knights Hermann von Salza and Hermann Balk, signed the city charters for Toruń (Thorn) and Chełmno (Kulm). The original document was lost in 1244. The set of rights in general is known as Kulm law. In 1236, due to frequent flooding, it was relocated to the present site of the Old Town. In 1239 Franciscan friars settled in the city, followed in 1263 by Dominicans. In 1264 the adjacent New Town was founded predominantly to house Torun's growing population of craftsmen and artisans, who predominantly came from German-speaking lands. In 1280, the city (or as it was then, both cities) joined the mercantile Hanseatic League, and thus became an important medieval trade centre. The city was recaptured by Poland in 1410 during the Polish–Lithuanian–Teutonic War however, after the First Peace of Thorn was signed in the city in February 1411, the city fell back to the Teutonic Order. In 1411, the city left the Hanseatic League. In the 1420s, Polish King Władysław II Jagiełło built the Dybów Castle, located in present-day left-bank Toruń, which he visited numerous times. During the next big Polish–Teutonic War, the Dybów Castle was occupied by the Teutonic Knights from 1431 to 1435. In 1440, the gentry of Thorn co-founded the Prussian Confederation to further oppose the Knights' policies. From 1452, talks between the Polish King Casimir IV Jagiellon and the burghers of the Confederation were held in the Dybów Castle. The Confederation rose against the Monastic state of the Teutonic Knights in 1454 and its delegation submitted a petition to Polish King Casimir IV Jagiellon asking him to regain power over the region as the rightful ruler. An act of incorporation was signed in Kraków (6 March 1454), recognizing the region (including Toruń), as part of the Polish Kingdom. These events led to the Thirteen Years' War. The citizens of the city enraged by the Order's ruthless exploitation, conquered the Teutonic castle, and dismantled the fortifications brick by brick, except for the Gdanisko tower which was used until the 18th century for the gunpowder storage. The local mayor pledged allegiance to the Polish King during the incorporation in March 1454 in Kraków, and then in May 1454, an official ceremony was held in Toruń, during which the nobility, knights, landowners, mayors and local officials from Chełmno Land, including Toruń, again solemnly swore allegiance to the Polish King and the Kingdom of Poland. Since 1454,