Implemented tournament selection.