This is the code for threshold testing

Nice colorful output and plots! using the legend function. nice. takes
a long time!