Added new createDomain function