Added a flag to control loop order to the builder.