add new pseudocode for matching algorithm