Updated peak detection example