And can you give me an example of an algorithm? EDIT: And then how would I calculate the math using Javascript? Can someone add that? Sorry to not include ...