use typed array for peaks