Setting foundation for matching algorithm