In the Middle Ages, kings and queens ruled over large areas of land. Loyal noblemen maintained large sections of the monarch's territory. This hierarchical organization in which people were divided into classes based on social position and wealth became known as the feudal system. In the feudal system, vassals and serfs produced for themselves and people of higher classes by using the ruler's land and resources. Although a large part of labor was employed in agriculture, artisans contributed to economic output and formed guilds. The guild system, operating mainly between 1100 and 1500, consisted of two types: merchant guilds, who bought and sold goods, and craft guilds, which made goods. Although guilds were regulated as to the quality of work performed, the resulting system was rather rigid, shoemakers, for example, were prohibited from tanning hides.