refactored tests and code
added selection and mating