bug fixes and simplifying sampling