Implement threshold and test