Wave algorithm done