Added hash tables to check whether IP/hostname:port have already been checked...
Added hash tables to check whether IP/hostname:port have already been checked and skip if they have. Changed order of function declaration so that it actually gets used.