added working vertical matching checking in the checkMatches function