modified loadgen_NB.py to define duration instead of # of groups; refactor functions.