Due to the type of soil, the valley in which it is located, is flooded in the rainy season and retains high humidity almost all year. To remedy this problem, the Maya developed an advanced system of hydraulic works: a network of canals drained the valley and the water was taken to a lagoon, which was transformed into dam through retaining walls, while other canals were used to irrigate the fields. This led to an optimum degree of moisture in the soil for intensive cultivation while the canals provided abundant fishing, and were used as communication routes and in some cases served as a defense. The plazas had a magnificent drain system and the rainwater reached artificial reservoirs called chultunes.