functional trheshold and gray