Move main() to top.