Added shift helper function