Updated matching algorithm for the new ast