Minor edits

Added a function to write the sample points and weights to a file for later processing. Minor cleaning up of code.