added an external sampling function
fixed external sampler and added a test to the .html doc
merging changes to function that samples from an array