Only ping where needed
Switch to bitmask for closed ports
Const correctness