Call main() directly instead of using window.onload.