added smooth branching peak detector