Updated monad definition