wave algorithm update