Before I forget it a rough draft (code) how the noise based smearing works. Please note the comments.