Incorporated the handling of the shift issue.