script now more self-contained as a plug-in