moved avoidnasty() to the top of the script
portlist() returns a ... list of ports.