refactoring a bit
working version with random teams