created team generation algorithm