improve example max-amplitude feature