added legend to graphs