Adding MR code for population generation