In the 14th century Haarlem was a major city. It was the second largest city in historical Holland after Dordrecht and before Delft, Leiden, Amsterdam, Gouda and Rotterdam. In 1429 the city gained the right to collect tolls, including ships passing the city on the Spaarne river. At the end of the Middle Ages Haarlem was a flourishing city with a large textile industry, shipyards and beer breweries. Around 1428 the city was put under siege by the army of Jacqueline, Countess of Hainaut. Haarlem had taken side with the Cods in the Hook and Cod wars, and thus against Jacoba of Bavaria. The entire Haarlemmerhout wood was burnt down by the enemy.