Added threads to find the smallest