Significantly removed the amount of code in valMatch