initial version of plugin code