More robust and portable MAC implimentation