Improved plugin sort