Fixed matching algorithm.