moved code from sample to plugin"