code can now recieve a list of ip addresses