main generator