Add threshold functions! Yay!