function checkFlags created to check sets of flags against the global flag hash.