moved mac code to CVDisplayLink usage instead of timer