generate data looping order changed. now graph size is outermost loop