Preparation of ligands