Completed applyShift wrapper function