added a function to obtain a shift