implemented vsync