Updates to matching algorithm and printing functions