multiple threshold support added