renamed num_subdomains to n_subdomains