shift algorithm mean