The skin is the body's largest organ and has three layers - the epidermis, dermis and subcutaneous layer. The epidermis is the outermost layer and contains cells that produce melanin, which determines skin color. The dermis lies beneath the epidermis and contains nerve endings, blood vessels, sweat and oil glands. The innermost subcutaneous layer contains fat and connects the skin to underlying tissues. The skin acts as a protective barrier and plays a role in temperature regulation and sensation.