moved generator from main to run