mac changes + start of lua receive code