updating source to toggle between random and stratified sampling
fixing conflicts after merge with stratified sampling branch