Molecules on the sperm and eggs of hermaphroditic organisms ensures that they mate with others. Karen Hopkin reports.