added thrsholding to header file