input_pairs needs to be initialised to NULL