refactored some of Adrian's code to update graphics instead of creating new ones