The Fermilab Main Injector project is building 344 dipoles using more than 7000 tons of steel. There were significant run-to-run variations in the magnetic properties of the steel. Differences in stress relief in the steel after stamping resulted in variations of gap height. To minimize magnet-to-magnet strength and field shape variations the laminations were shuffled based on the available magnetic and mechanical data and assigned to magnets using a computer program based on the method of simulated annealing. The lamination sets selected by the program have produced magnets which easily satisfy the design requirements. This paper discusses observed gap variations, the program structure and the strength uniformity results for the magnets produced.