Insects gain kinetic energy, provided by the muscles, when they accelerate. When the wings begin to decelerate toward the end of the stroke, this energy must dissipate. During the downstroke, the kinetic energy is dissipated by the muscles themselves and is converted into heat (this heat is sometimes used to maintain core body temperature). Some insects are able to utilize the kinetic energy in the upward movement of the wings to aid in their flight. The wing joints of these insects contain a pad of elastic, rubber-like protein called resilin. During the upstroke of the wing, the resilin is stretched. The kinetic energy of the wing is converted into potential energy in the stretched resilin, which stores the energy much like a spring. When the wing moves down, this energy is released and aids in the downstroke.