added a bunch of graphics code