updating source to toggle between random and stratified sampling