main process