Added the method to calculate threshold