some stuff added, seth your job is to learn how my code works. gabriel
your job is to implement double buffering