public function offsetCorrection($Value, $Mode)
    {
        $Value = round($Value, 1);

        if ($Value == 0 && $Mode != 1) {
            return 0;
        }

        if ($Mode == 1) {
            if ($Value == .5) {
                return .5;
            }
            if ($Value == .8) {
                return .6;
            }
            if (in_array($Value, [.4, .7])) {
                return .7;
            }
            if (in_array($Value, [.2, .3, .6])) {
                return .8;
            }
            if (in_array($Value, [0, 1, .1, .9])) {
                return .9;
            }
        }

        if ($Mode == 2) {
            if ($Value == .1) {
                return .1;
            }
            if ($Value == .2) {
                return .2;
            }
            if ($Value == .3) {
                return .3;
            }
            if ($Value == .4) {
                return .4;
            }
            if ($Value == .5) {
                return .5;
            }
            if ($Value == .7) {
                return .7;
            }
            if (in_array($Value, [.6, .8])) {
                return .8;
            }
            if (in_array($Value, [1, .9])) {
                return .9;
            }
        }

        if ($Mode == 3) {
            if (in_array($Value, [1, .1])) {
                return .1;
            }
            if ($Value == .2) {
                return .2;
            }
            if ($Value == .3) {
                return .3;
            }
            if (in_array($Value, [.4, .8])) {
                return .4;
            }
            if ($Value == .5) {
                return .9;
            }
            if ($Value == .6) {
                return .6;
            }
            if ($Value == .7) {
                return .7;
            }
            if ($Value == .9) {
                return .5;
            }
        }

        if ($Mode == 4) {
            if ($Value == 1) {
                return -1;
            }
            if (in_array($Value, [.1, .4, .7, .8, .9])) {
                return .1;
            }
            if ($Value == .2) {
                return .2;
            }
            if ($Value == .3) {
                return .3;
            }
            if ($Value == .5) {
                return -.1;
            }
            if ($Value == .6) {
                return .8;
            }
        }
    }