Rewritten log functions in monadic style. Comment changes.