Main process defined