diff --git a/Nomyx-Language.cabal b/Nomyx-Language.cabal
--- a/Nomyx-Language.cabal
+++ b/Nomyx-Language.cabal
@@ -1,5 +1,5 @@
 name: Nomyx-Language
-version: 0.7.1
+version: 0.7.2
 cabal-version: >=1.6
 ---Warning: to use "cabal sdist", this patch is needed in cabal: https://github.com/haskell/cabal/pull/1110
 ---This allows cabal to work with exported generated modules (Paths_Nomyx_Language)
@@ -40,6 +40,7 @@
                    ghc                >= 7.6 && <= 7.10,
                    mtl                == 2.1.*,
                    old-locale         == 1.0.*,
+                   random             == 1.0.*,
                    safe               == 0.3.*,
                    time               == 1.4.*,
                    time-recurrence    == 0.9.*
diff --git a/src/Language/Nomyx/Events.hs b/src/Language/Nomyx/Events.hs
--- a/src/Language/Nomyx/Events.hs
+++ b/src/Language/Nomyx/Events.hs
@@ -13,7 +13,7 @@
    oneWeek, oneDay, oneHour, oneMinute,
    timeEvent, messageEvent, victoryEvent, playerEvent, ruleEvent,
    baseEvent, baseInputEvent,
-   liftNomexNE
+   liftEvent
    ) where
 
 import Language.Nomyx.Expression
@@ -148,5 +148,5 @@
 baseInputEvent :: (Typeable a) => PlayerNumber -> String -> (InputForm a) -> Field a
 baseInputEvent pn s iform = Input pn s iform
 
-liftNomexNE :: NomexNE a -> Event a
-liftNomexNE = LiftNomexNE
+liftEvent :: NomexNE a -> Event a
+liftEvent = LiftEvent
diff --git a/src/Language/Nomyx/Examples.hs b/src/Language/Nomyx/Examples.hs
--- a/src/Language/Nomyx/Examples.hs
+++ b/src/Language/Nomyx/Examples.hs
@@ -4,6 +4,7 @@
 
 -- | This file gives a list of example rules that the players can submit.
 --You can copy-paste them in the field "Code" of the web GUI.
+--You can copy either the name of the function (i.e. "helloWorld") or its body (i.e. "outputAll_ "hello, world!""), but NOT both.
 --Don't hesitate to get inspiration from there and create your own rules!
 module Language.Nomyx.Examples(
    nothing,
@@ -89,7 +90,7 @@
 moneyTransfer = do
    let askAmount :: PlayerNumber -> Event (PlayerNumber, Int)
        askAmount src = do
-          pls <- liftNomexNE getAllPlayerNumbers
+          pls <- liftEvent getAllPlayerNumbers
           guard (length pls >= 2) >> do
              dst <- inputRadio' src "Transfer money to player: " (delete src $ sort pls)
              amount <- inputText src ("Select Amount to transfert to player " ++ show dst ++ ": ")
@@ -103,8 +104,8 @@
    if (amount > 0 && fromJust balance >= amount) then do
       modifyValueOfPlayer dst accounts (\a -> a + amount)
       modifyValueOfPlayer src accounts (\a -> a - amount)
-      void $ newOutput_ (Just src) ("You gave " ++ (show amount) ++ " ecus to player " ++ show dst)
-      void $ newOutput_ (Just dst) ("Player " ++ show src ++ " gave you " ++ (show amount) ++ "ecus")
+      void $ newOutput_ (Just src) ("You gave " ++ (show amount) ++ " ecu(s) to player " ++ show dst)
+      void $ newOutput_ (Just dst) ("Player " ++ show src ++ " gave you " ++ (show amount) ++ " ecu(s)")
    else void $ newOutput_ (Just src) ("Insufficient balance or wrong amount")
 
 -- | delete a rule
@@ -215,7 +216,7 @@
    let displayMsg a = void $ newOutput_ Nothing ("Msg: " ++ a)
    --create a button for me, which will display the output when clicked
    let button = do
-       all <- liftNomexNE getPlayers
+       all <- liftEvent getPlayers
        guard (length all >= 2) >> inputText me "send a message"
    void $ onEvent_ button displayMsg
 
diff --git a/src/Language/Nomyx/Expression.hs b/src/Language/Nomyx/Expression.hs
--- a/src/Language/Nomyx/Expression.hs
+++ b/src/Language/Nomyx/Expression.hs
@@ -22,6 +22,7 @@
 import Data.Lens.Template
 import Control.Monad.Error
 import Control.Shortcut
+import System.Random
 
 type PlayerNumber = Int
 type PlayerName = String
@@ -54,42 +55,43 @@
 
 data Exp :: Eff -> * -> *   where
    --Variables management
-   NewVar         :: (Typeable a, Show a) => VarName -> a -> Nomex (Maybe (V a))
-   ReadVar        :: (Typeable a, Show a) => V a -> NomexNE (Maybe a)
-   WriteVar       :: (Typeable a, Show a) => V a -> a -> Nomex Bool
-   DelVar         :: (V a) -> Nomex Bool
+   NewVar          :: (Typeable a, Show a) => VarName -> a -> Nomex (Maybe (V a))
+   ReadVar         :: (Typeable a, Show a) => V a -> NomexNE (Maybe a)
+   WriteVar        :: (Typeable a, Show a) => V a -> a -> Nomex Bool
+   DelVar          :: (V a) -> Nomex Bool
    --Events management
-   OnEvent        :: (Typeable e, Show e) => Event e -> ((EventNumber, e) -> Nomex ()) -> Nomex EventNumber
-   DelEvent       :: EventNumber -> Nomex Bool
-   GetEvents      :: NomexNE [EventInfo]
-   SendMessage    :: (Typeable a, Show a) => Msg a -> a -> Nomex ()
+   OnEvent         :: (Typeable e, Show e) => Event e -> ((EventNumber, e) -> Nomex ()) -> Nomex EventNumber
+   DelEvent        :: EventNumber -> Nomex Bool
+   GetEvents       :: NomexNE [EventInfo]
+   SendMessage     :: (Typeable a, Show a) => Msg a -> a -> Nomex ()
    --Rules management
-   ProposeRule    :: RuleInfo -> Nomex Bool
-   ActivateRule   :: RuleNumber -> Nomex Bool
-   RejectRule     :: RuleNumber -> Nomex Bool
-   AddRule        :: RuleInfo -> Nomex Bool
-   ModifyRule     :: RuleNumber -> RuleInfo -> Nomex Bool
-   GetRules       :: NomexNE [RuleInfo]
+   ProposeRule     :: RuleInfo -> Nomex Bool
+   ActivateRule    :: RuleNumber -> Nomex Bool
+   RejectRule      :: RuleNumber -> Nomex Bool
+   AddRule         :: RuleInfo -> Nomex Bool
+   ModifyRule      :: RuleNumber -> RuleInfo -> Nomex Bool
+   GetRules        :: NomexNE [RuleInfo]
    --Players management
-   GetPlayers     :: NomexNE [PlayerInfo]
-   SetPlayerName  :: PlayerNumber -> PlayerName -> Nomex Bool
-   DelPlayer      :: PlayerNumber -> Nomex Bool
+   GetPlayers      :: NomexNE [PlayerInfo]
+   SetPlayerName   :: PlayerNumber -> PlayerName -> Nomex Bool
+   DelPlayer       :: PlayerNumber -> Nomex Bool
    --Outputs
-   NewOutput      :: Maybe PlayerNumber -> NomexNE String -> Nomex OutputNumber
-   GetOutput      :: OutputNumber -> NomexNE (Maybe String)
-   UpdateOutput   :: OutputNumber -> NomexNE String -> Nomex Bool
-   DelOutput      :: OutputNumber -> Nomex Bool
+   NewOutput       :: Maybe PlayerNumber -> NomexNE String -> Nomex OutputNumber
+   GetOutput       :: OutputNumber -> NomexNE (Maybe String)
+   UpdateOutput    :: OutputNumber -> NomexNE String -> Nomex Bool
+   DelOutput       :: OutputNumber -> Nomex Bool
    --Mileacenous
-   SetVictory     :: NomexNE [PlayerNumber] -> Nomex ()
-   CurrentTime    :: NomexNE UTCTime
-   SelfRuleNumber :: NomexNE RuleNumber
+   SetVictory      :: NomexNE [PlayerNumber] -> Nomex ()
+   CurrentTime     :: NomexNE UTCTime
+   SelfRuleNumber  :: NomexNE RuleNumber
+   GetRandomNumber :: Random a => (a, a) -> Nomex a
    --Monadic bindings
-   Return         :: a -> Exp e a
-   Bind           :: Exp e a -> (a -> Exp e b) -> Exp e b
-   ThrowError     :: String -> Exp Effect a
-   CatchError     :: Nomex a -> (String -> Nomex a) -> Nomex a
-   LiftEffect     :: NomexNE a -> Nomex a
-   Simu           :: Nomex a -> NomexNE Bool -> NomexNE Bool
+   Return          :: a -> Exp e a
+   Bind            :: Exp e a -> (a -> Exp e b) -> Exp e b
+   ThrowError      :: String -> Exp Effect a
+   CatchError      :: Nomex a -> (String -> Nomex a) -> Nomex a
+   LiftEffect      :: NomexNE a -> Nomex a
+   Simu            :: Nomex a -> NomexNE Bool -> NomexNE Bool
 
 
 #if __GLASGOW_HASKELL__ >= 708
@@ -158,7 +160,7 @@
    BindEvent      :: Event a -> (a -> Event b) -> Event b                 -- A First event should fire, then a second event is constructed
    ShortcutEvents :: [Event a] -> ([Maybe a] -> Bool) -> Event [Maybe a]  -- Return the intermediate results as soon as the function evaluates to True, dismissing the events that hasn't fired yet
    BaseEvent      :: (Typeable a) => Field a -> Event a                   -- Embed a base event
-   LiftNomexNE    :: NomexNE a -> Event a                                 -- create an event containing the result of the NomexNE.
+   LiftEvent      :: NomexNE a -> Event a                                 -- create an event containing the result of the NomexNE.
    deriving Typeable
 
 -- | Base events
diff --git a/src/Language/Nomyx/Players.hs b/src/Language/Nomyx/Players.hs
--- a/src/Language/Nomyx/Players.hs
+++ b/src/Language/Nomyx/Players.hs
@@ -26,7 +26,8 @@
    showPlayer,
    getProposerNumber, getProposerNumber_,
    setVictory, 
-   giveVictory
+   giveVictory,
+   getRandomNumber
    ) where
 
 import Language.Nomyx.Expression
@@ -39,6 +40,7 @@
 import Control.Applicative
 import Control.Arrow
 import Control.Monad
+import System.Random
 
 -- * Players
 
@@ -149,3 +151,9 @@
 
 getProposerNumber_ :: Nomex PlayerNumber
 getProposerNumber_ = liftEffect getProposerNumber
+
+-- | get a random number uniformly distributed in the closed interval [lo,hi]
+-- resets the number generator
+getRandomNumber :: Random a => (a, a) -> Nomex a
+getRandomNumber = GetRandomNumber
+
diff --git a/src/Language/Nomyx/Rules.hs b/src/Language/Nomyx/Rules.hs
--- a/src/Language/Nomyx/Rules.hs
+++ b/src/Language/Nomyx/Rules.hs
@@ -52,7 +52,7 @@
 activateRule_ :: RuleNumber -> Nomex ()
 activateRule_ r = activateRule r >> return ()
 
--- | reject a rule: change its state to Suppressed and suppresses all its environment (events, variables, inputs)
+-- | reject a rule: change its state to Suppressed and suppresses all its environment (events, variables, inputs, victory)
 -- the rule can be activated again later
 rejectRule :: RuleNumber -> Nomex Bool
 rejectRule = RejectRule
diff --git a/src/Language/Nomyx/Variables.hs b/src/Language/Nomyx/Variables.hs
--- a/src/Language/Nomyx/Variables.hs
+++ b/src/Language/Nomyx/Variables.hs
@@ -109,7 +109,7 @@
 readMsgVar_ mv = partial "readMsgVar_: variable not existing" (liftEffect $ readMsgVar mv)
 
 modifyMsgVar :: (Typeable a, Show a) => MsgVar a -> (a -> a) -> Nomex Bool
-modifyMsgVar mv f = writeMsgVar mv . f =<< readMsgVar_ mv
+modifyMsgVar mv f = readMsgVar_ mv >>= writeMsgVar mv . f 
 
 delMsgVar :: (Typeable a, Show a) => MsgVar a -> Nomex Bool
 delMsgVar (MsgVar m v) = do
diff --git a/src/Language/Nomyx/Vote.hs b/src/Language/Nomyx/Vote.hs
--- a/src/Language/Nomyx/Vote.hs
+++ b/src/Language/Nomyx/Vote.hs
@@ -67,7 +67,7 @@
 -- | the vote can be concluded as soon as the result is known.
 voteWith :: UTCTime -> AssessFunction -> String -> Event [(PlayerNumber, Maybe Bool)]
 voteWith timeLimit assess title = do
-   pns <- liftNomexNE getAllPlayerNumbers
+   pns <- liftEvent getAllPlayerNumbers
    let voteEvents = map (singleVote title) pns
    let timerEvent = timeEvent timeLimit
    let isFinished votes timer = isJust $ assess $ getVoteStats votes timer
