(Match import) Added some of the final match insertion code