Rewrite failed

cannot implement the true streaming peak detection. Maybe need three
slot to store the state.