added applyShift fn