Modified sample and psample to accept named_vars for trace; added example with deterministic