switched threshold to logarithmic