Changed sound output to write to one buffer and changed listening algorithm to detect a tone if 2 or greater frequencies are above the threshold and the two greatest are more than 10 greater than the third