Adjusted to fix any minor glitches