It is made in the roots of and accumulates in the leaves of the nightshade family of plants. It functions as an antiherbivore chemical; consequently, nicotine was widely used as an insecticide in the past and nicotine analogs such as imidacloprid are currently widely used. This stimulant effect is likely to be a major contributing factor to the dependence-forming properties of tobacco smoking.