change main according to wavegen