Added threshold parameter to Integrate.