Better unique string implementation
No memory leaks, less logic