Normal Sampling file added, and a couple of utility functions