Fix looping over temp_CAD.txt that exited after reading the first line, fix chunkno to loop from 1 to the number of threads