modified for mac users