working on code for graphs