Reduction of nitriles gives primary amines, while reduction of amides can give primary, secondary, and tertiary amines. Nitriles are formed from alkyl halides through an SN2 reaction involving an attack of the cyanide nucleophile. A further reduction by LiAlH4 or catalytic hydrogenation forms the amine. Since the reaction follows an SN2 mechanism in the first step, primary alkyl halides are the preferred substrates, and the reaction gives primary amines. The overall reaction replaces the halide with an amino group while also introducing an additional carbon atom. Amides are prepared from carboxylic acid derivatives through condensation reactions with ammonia. They are further reduced to give amines. Amide reduction only introduces the amino group without an extra carbon in the skeleton, while nitrile reduction installs an amino group and extends the carbon chain. During amide reduction, the class of amine formed depends on the degree of alkylation at the amide nitrogen.