The IP address is taken from the lists. The script rewritten to use functions with parameters.