change maxpopulation computation