Added function for port scanning. Imported thread library.