simple algorithm..... anybody can do it! google it :P