create_domains: added sorting