added legend to graph