Adding CPU forward matching algorithm.