Adding wave running function