change list of hosts to a dictionary