main to init