Nested the database queries. Assign_Teams is now passed the correct values