added Threshold class, moved calibrate to be a method of class