Added the creation of new domain. Still has some bugs.