added global main func