added mac os native code (wip)