def match(word_list, expected_type):
    """Extract head word, if the type matches return worn else None."""
    if word_list:
        word = word_list.pop(0)
        if word[0] == expected_type:
            return word
        else:
            return None
    else:
        return None