FInished (other than the maxpopulation) Population counting and stuff