modified popInitialize.R