Added check_mac function, but untested!