Finalized plugin code