Improve algorithm and tune-up threshold values.