better algorithm.