code to pull hosts