Rebuild plugin

The plugin is completely re-written