added points 1 and 2 into the headcount code. Still more work to do.