     }
     
     func title(forSection section: Int) -> String {
-        return "Team \(section + 1)"
+        var headerString = "Team \(section + 1)"
+        if teamSize(forSection: section) != teamSize {
+            headerString +=  " (\(teamSize(forSection: section)))"
+        }
+        return headerString
     }
     
     func numberOfSections(in collectionView: UICollectionView) -> Int {
-        print("**Number of sections: \(numberOfTeams)")
         return numberOfTeams
     }
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        print("---\(students(inSection: section).count) in section \(section)")
         return students(inSection: section).count
     }
     

import UIKit

class RandomizerDataSource: NSObject, UICollectionViewDataSource {

    var core = App.core
    var students = [Student]()
    var teamSize = 2
    
    var sectionSize: Int {
        return students.count / teamSize
    }
    
    deinit {
        core.remove(subscriber: self)
    }

    }

    var numberOfTeams: Int {
        let standardNumberOfTeams = students.count / teamSize
        if remainder == 2 && teamSize == 3 {
            return standardNumberOfTeams + 1
        }
        return remainder > 2 ? standardNumberOfTeams + 1 : standardNumberOfTeams
    }
    
    func teamSize(forSection section: Int) -> Int {
        let isLastSection = section == numberOfTeams - 1
        let isPenultimateSection = section == numberOfTeams - 2
        
        switch remainder {
        case 0:
            return teamSize
        case 1:
            return isLastSection ? teamSize + 1 : teamSize
        case 2:
            if teamSize == 3 {
                if isLastSection {
                    return  remainder
                } else if isPenultimateSection {
                    return teamSize
                }
            }
            return isLastSection || isPenultimateSection ? teamSize + 1 : teamSize
        default:
            return isLastSection ? remainder : teamSize
        }
    }
    
    func students(inSection section: Int) -> [Student] {
        let lowBoundSection = section == 0 ? 0 : section - 1
        let lowBound = section * teamSize(forSection: lowBoundSection)
        let highBound = lowBound + teamSize(forSection: section)
        return students.step(from: lowBound, to: highBound)
    }
