added the plugin function - minimal code