modified for mac