Let's try this one last time. Fixed foreach loop for teams