Major rework of the original plugin