Added create_domain and domain subroutines