added some of the plugin stuff, not quite finished with it.