converted plugin to prototype format