Started writing an alternative checkMatch() function. Modified the existing one slightly