@KshitijT, not to sound like an ungrateful bastard, but can I take issue with the parameter name? How about ncpu_img? Seeing as it has the same meaning as ncpu, but for the imaging? clean_threads is calling the same beast by a different name, somewhat out of the blue.