diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,3 +40,8 @@
 
 * Third version. Removed vector-related functionality and changed it to the array-based. Improved the pairs construction
 for the 'ф' -- 'в' pair (It is phonetically, actually, not in Ukraniian, but it is connected for being more defined). Added a lightweight dependency of foldable-ix package.
+
+## 0.4.0.0 -- 2021-11-04
+
+* Fourth version. Added new function to the Numeric.Wrapper.R.GLPK.Phonetics.Ukrainian.Durations module.
+Some code improvements. Changed the imported module from the ukrainian-phonetics-basic-array and base packages.
diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -1,6 +1,6 @@
 -- |
 -- Module      :  Main
--- Copyright   :  (c) OleksandrZhabenko 2020
+-- Copyright   :  (c) OleksandrZhabenko 2020-2021
 -- License     :  MIT
 -- Stability   :  Experimental
 -- Maintainer  :  olexandr543@yahoo.com
@@ -30,7 +30,7 @@
 import Text.Read
 import Data.List
 import Data.Maybe (fromMaybe)
-import Melodics.ByteString.Ukrainian.Arr
+import Melodics.Ukrainian.ArrInt8
 
 
 main :: IO ()
@@ -56,7 +56,7 @@
       xss = map words . lines $ contents
       words2 = map head xss
       lengths0 = map ((\ts -> read ts::Double) . last) xss
-      bss = map (sort . charReplace . convertToProperUkrainianS) words2
+      bss = map (sort . charReplace . map s8toChar . convertToProperUkrainianI8) words2
       js = tail . nub . sort . unwords $ bss
   putStrLn . answer lstCfs bss (map (*coeff) lengths0) (map (* (1.0 / coeff)) lengths0) $ js
 
diff --git a/Numeric/Wrapper/R/GLPK/Phonetics/Ukrainian/Durations.hs b/Numeric/Wrapper/R/GLPK/Phonetics/Ukrainian/Durations.hs
--- a/Numeric/Wrapper/R/GLPK/Phonetics/Ukrainian/Durations.hs
+++ b/Numeric/Wrapper/R/GLPK/Phonetics/Ukrainian/Durations.hs
@@ -3,7 +3,7 @@
 
 -- |
 -- Module      :  Numeric.Wrapper.R.GLPK.Phonetics.Ukrainian.Durations
--- Copyright   :  (c) OleksandrZhabenko 2020
+-- Copyright   :  (c) OleksandrZhabenko 2020-2021
 -- License     :  MIT
 -- Stability   :  Experimental
 -- Maintainer  :  olexandr543@yahoo.com
@@ -37,9 +37,10 @@
 import Data.Monoid hiding (mconcat)
 import Text.Read
 import Data.Maybe
-import CaseBi.Arr (getBFstL')
+import CaseBi.Arr (getBFstLSorted')
 import Data.Foldable (foldl')
 import GHC.Arr
+import GHC.Int
 import Numeric
 import Data.List (intercalate)
 import Data.Lists.FLines (newLineEnding)
@@ -124,7 +125,7 @@
              (21, unsafeAt arr 6), (22, unsafeAt arr 27), (23, unsafeAt arr 0), (24, unsafeAt arr 13),
               (25, unsafeAt arr 28), (26, unsafeAt arr 29), (27, unsafeAt arr 7), (28, unsafeAt arr 14),
                 (29, unsafeAt arr 30), (30, unsafeAt arr 8), (31, unsafeAt arr 31)] in
-                  take 32 . map (getBFstL' 1.0 lst) $ [0..31]
+                  take 32 . map (getBFstLSorted' 1.0 lst) $ [0..31]
 
 maxLine :: String
 maxLine = "max1 <- TRUE\n"
@@ -147,7 +148,7 @@
 
 minDurations :: [Double]
 minDurations = map h [0..31]
-  where h i = if i == 23 then 0.02 else getBFstL' 0.06 (zip [7,11,15,21,27,30] . replicate 6 $ 0.2) i
+  where h i = if i == 23 then 0.02 else getBFstLSorted' 0.06 (zip [7,11,15,21,27,30] . replicate 6 $ 0.2) i
 
 maxDurations :: [Double]
 maxDurations = replicate 32 0.3
@@ -181,8 +182,14 @@
 charReplace :: [Char] -> [Char]
 charReplace = concatMap g
  where g x
-        | x == '-' = "X"
         | x == '0' = "Y"
         | x == 'w' = "cq"
         | x == 'D' = "sq"
         | otherwise = [x]
+{-# INLINE charReplace #-}
+
+s8toChar :: Int8 -> Char
+s8toChar = getBFstLSorted' ' ' [(1,'a'),(2,'e'),(3,'o'),(4,'u'),(5,'y'),(6,'i'),(7,'q'),(8,'A'),(10,'B'),(15,'b'),(17,'d'),
+   (19,'g'),(21,'h'),(23,'j'),(25,'z'),(27,'C'),(28,'l'),(30,'m'),(32,'n'),(34,'r'),(36,'v'),(38,'c'),(39,'E'),(41,'F'),
+     (43,'f'),(45,'k'),(47,'p'),(49,'s'),(50,'t'),(52,'x'),(54,'D'),(66,'w')]
+{-# INLINE s8toChar #-}
diff --git a/r-glpk-phonetic-languages-ukrainian-durations.cabal b/r-glpk-phonetic-languages-ukrainian-durations.cabal
--- a/r-glpk-phonetic-languages-ukrainian-durations.cabal
+++ b/r-glpk-phonetic-languages-ukrainian-durations.cabal
@@ -3,7 +3,7 @@
 -- http://haskell.org/cabal/users-guide/
 
 name:                r-glpk-phonetic-languages-ukrainian-durations
-version:             0.3.0.0
+version:             0.4.0.0
 synopsis:            Can be used to calculate the durations of the approximations of the Ukrainian phonemes.
 description:         Can be used to calculate the durations of the approximations of the Ukrainian phonemes using some prepared text with its correct (at least mostly) pronunciation. The prepared text is located in the same directory and contains lines --- the Ukrainian word and its duration in seconds separated with whitespace.
 homepage:            https://hackage.haskell.org/package/r-glpk-phonetic-languages-ukrainian-durations
@@ -21,7 +21,7 @@
   exposed-modules:     Numeric.Wrapper.R.GLPK.Phonetics.Ukrainian.Durations
   other-modules:       Main
   other-extensions:    CPP
-  build-depends:       base >=4.8 && <4.15, mmsyn2-array >=0.1.1 && <1, ukrainian-phonetics-basic-array >=0.1.1 && <1, lists-flines >=0.1.1 && <1, foldable-ix >=0.1 && <1
+  build-depends:       base >=4.8 && <4.16, mmsyn2-array >=0.3 && <1, ukrainian-phonetics-basic-array >=0.4.1 && <1, lists-flines >=0.1.1 && <1, foldable-ix >=0.1 && <1
   -- hs-source-dirs:
   default-language:    Haskell2010
 
@@ -29,6 +29,6 @@
   main-is:             Main.hs
   other-modules:       Numeric.Wrapper.R.GLPK.Phonetics.Ukrainian.Durations
   -- other-extensions:
-  build-depends:       base >=4.8 && <4.15, mmsyn2-array >=0.1.1 && <1, ukrainian-phonetics-basic-array >=0.1.1 && <1, lists-flines >=0.1.1 && <1, foldable-ix >=0.1 && <1
+  build-depends:       base >=4.8 && <4.16, mmsyn2-array >=0.3 && <1, ukrainian-phonetics-basic-array >=0.4.1 && <1, lists-flines >=0.1.1 && <1, foldable-ix >=0.1 && <1
   -- hs-source-dirs:
   default-language:    Haskell2010
