updated graphics code