Modify for main function.