Added code for threading and PopulateWorker