Added sampler.
Added const reference.
Added docstring.
Added documentation, made move_pointer and write methods private.