updated population script to fix bug