Add a transaction function to sample.
Use atoms instead of refs to cover failing dosyncs
Merge pull request #11 from JacekLach/use-atoms-not-refs

Use atoms instead of refs