Added uniqueId function and its test