fixed initializeGraphics() function