Added support for MongoDB sharding. Replaced forEach with for loops