Add some asserts.
Add attempt at implementing crp sampling.