Implemeting the mac_lookup