Use threads to speed up scanning