Updated to refactor out the matches stuff
Fixed merge conflicts
Merge