added threshold method and updated tests relating to this