added comments to graphics.cpp