Export main function.