rewrote plugin code.