Speed up renerding of stacked graph by avoiding the loop in