tweeked threshold, and added some more debug info