fix a few typo
add tests for mating functions