allow -main and user-defined main