better code for mac