addElement :: (Ord a) => 
                  (NGram a, MarkovChain a) -> a -> (NGram a, MarkovChain a)
    addElement (n, MarkovChain m) a = (n', MarkovChain m')
        where n' = shiftAppend n a
              m' = case Map.lookup n m of
                     Nothing -> Map.insert n (RandSet.add (a,1) RandSet.empty) m
                     Just r  -> Map.insert n (RandSet.add (a,1) r) m
addElement :: (Ord a) => 
                  (NGram a, MarkovChain a) -> a -> (NGram a, MarkovChain a)
addElement (n, MarkovChain m) a = (n', MarkovChain m')
        where n' = shiftAppend n a
              m' = case Map.lookup n m of
                     Nothing -> Map.insert n (RandSet.add (a,1) RandSet.empty) m
                     Just r  -> Map.insert n (RandSet.add (a,1) r) m
addElement (n, MarkovChain m) a = (n', MarkovChain m')
        where n' = shiftAppend n a
              m' = case Map.lookup n m of
                     Nothing -> Map.insert n (RandSet.add (a,1) RandSet.empty) m
                     Just r  -> Map.insert n (RandSet.add (a,1) r) m