working with graph