The porcupine defends itself with between 15,000 and 30,000 needle-sharp quills whose barbs flare from the shaft, resisting being pulled out while also working themselves in. When challenged, it puts its head between its forelegs and turns its rump to the enemy. Solitary but not territorial, porcupines may resort to communal denning in cold weather. Breeding, complicated by the quills, occurs in late fall or early winter, and dens are chosen in rocky crevices or hollow logs, with a single kit born in spring. The porcupine is primarily nocturnal but may be seen resting in trees during the day. The underside of its tail is covered with stiff downward-pointing bristle that helps it climb, and it loves to chew and must be able to digest its favorite food, the inner bark of the tree.