Training code for pair selection included.