choose a suitable threshold