Finished. "double buffering" implemented