updated graphics.cpp