Made the plugin work as described