updated datadistribution.js to modular pattern