improve unique atoms routine