RK Match Algorithm written in C with testing scripts