Threshold beet better tested
Better debug info printing