Implemented UID generation.