Fiddling around with algorithm.