The integumentary system works as a barrier to pathogens and physical trauma that would be dangerous to internal body systems, and it slows down water loss. It consists of the skin and any accessory structures or substances such as scales, feathers, fur or slime.
In humans and many other animals that spend significant time in direct sunlight, the skin is also the site of vitamin D production. In humans, it serves as a site for excretion of waste products through sweat. It is a major sensory system, able to detect touch, pressure, pain, heat and cold.
The integumentary system is generally quite complex and varies greatly between groups of animals. In humans, the skin is composed of three major layers.
The epidermis is the topmost layer and has the function of protection and waterproofing. The cells primarily responsible for this produce keratin, a tough, fibrous protein. Beneath the epidermis is the dermis, which is full of connective tissues reinforced with collagen proteins. This layer gives the skin stretchiness and flexibility, while keeping it taut against the underlying tissues. The bottommost and thickest layer of skin is the hypodermis, which is mostly composed of cells that accumulate and store body fats.