changed uniquename to use sensible naming criteria