style nitpick: don't need the spaces in `$unique{$ditemid}`

(Also, we don't need the "exists", since we can go with the truth/false value of $unique{$ditemid})