changed naive hard coded stuff to MAX_HOSTS macros