Added threshold functions