Title: Efficient implementation of a shifting algorithm