add graphics code, unfinished