@Th4nat0s , you are checking for duplicate keys:

```
if ! host_port.has_key? host+":"+port
```

And yes, you can check for duplicates in an array with the ```include?``` method: http://www.ruby-doc.org/core-2.1.1/Array.html#method-i-include-3F