Implemented first version of snapshot sampling.