closed #15, added sampling methods