adapted to Mac