prettify code a bit
fix typos, naming
implement actual sampling