introducing the second and the third arguments for detection threshold
and output file