Rewrite WAVE functions to respect unknown chunks of different size
Update code