Created main routine