Wrote some sampling code