Touching up formatting, removing Math.Truncate calls, and allowing negative shift.