finished the core of the plugin