removed erroneous +
Refactored code to split matching, and checking

now the code to check a valid hash is simple,
and nicely isolated