fix equation (2) and threshold max values