Minor cleanups
Close TTY
Only do a DNS lookup if the host is reachable
Fix timing variables
Adjust initial variaible declarations
Reverse IPs if first is larger than second
Force printing before full buffer at top of script