impl of plugin added
clean working version