Added sorting for black/whitelists