better transactional semantics

fully re-entrant, stack-based