test curve matching algorithm