added graphics.c from common