switched to a separate bkg gen function