Added an init method to automatically set hostnames