Made threshhold variable