refactor sampling function for readability
Merge branch 'singular' of github.com:giraj/funksmplr into singular
add variables for readability