Adding box number generation and regeneration