Added a new constructor that automatically set hostnames