added some noise generating code