working on the threshold analysis