Started implementing algorithm.