BUGFIX:Index fixed in the noise thresholding code