Don't stack unique elements

Trimmed down to 4383 bytes