adding partial mr code for population generation