Fix for flickering

I replaced all ```flush``` calls with single ```swapBuffers``` in ```draw``` function and swapped ```initializeDisplayMode``` with ```createWindow```. There where some redundant white spaces.