first take at a mating algorithm