Algorithm changed. Cabal dependencies added