moore_algorithm
