that is not an algorithm, that just shows how to use the cheap build-in normal function -.- slin already gave a correct answere