Move main to end of plugin file