Moved some functions out of the Resampling file and into the Functions2 file.