Merge branch 'WriteOutSamples' into 'master'

renamed the function and output names and put in missing packages for functions used

See merge request !19
3 jobs for master in 10 minutes and 26 seconds (queued for 1 second)