c: modified threshold example