forked from: Threshold transition

