working version of plugin