The scrotum reacts to temperature. When it is cold, the scrotum shrinks, pulling the testes against the body to keep them warm. When it is hot, the scrotum relaxes, lowering the testes away from the body. This contractile ability of the scrotum can either raise or lower the temperature of the testes by a few degrees, ensuring that the optimum temperature for sperm production is maintained.