Ported example to OS X